<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroUsuario.aspx.cs" Inherits="MakeIT.MakeIT.Laundy.Agromotor.Site.Apresentacao.CadastroUsuario" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cHeadHttpEquiv" ContentPlaceHolderID="headHttpEquiv" runat="server">
</asp:Content>
<asp:Content ID="cHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="cCadastro" ContentPlaceHolderID="cphTituloCadastro" runat="server">
    Cadastro de Operadores&nbsp;do&nbsp;Sistema (usuario)
</asp:Content>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">

    <asp:UpdatePanel ID="upnUsuario" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabUsuario" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 100%; background-color:#eeeeff; min-width:400px; min-height:300px;">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td valign="middle" style="width:24px;">
                                        <asp:ImageButton ID="ibPesquisa" runat="server" OnClick="btnPesquisa_Click" 
                                                  ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/search.png" 
                                                  ToolTip="Executa a pesquisa aplicando os filtros"/>
                                    </td>
                                    <td valign="middle" align="left">
                                        Filtros:
                                    </td>
                                    <td>
                                        <div class="FormDiv">
                                            <div class="FormLabel">C&oacute;digo:</div>
                                            <asp:TextBox ID="txtIdUsuario" MaxLength="11" Width="76" onkeypress="onlyNum();" onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                            <asp:MaskedEditExtender ID="meetxtIdUsuario" runat="server" Mask="99999999999" TargetControlID="txtIdUsuario" PromptCharacter="" />
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">Nome:</div>
                                            <asp:TextBox ID="txtNome" MaxLength="45" Width="100" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">Email:</div>
                                            <asp:TextBox ID="txtEmail" MaxLength="45" Width="100" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">Login:</div>
                                            <asp:TextBox ID="txtUser" MaxLength="45" Width="100" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                        </div>
                                        <div class="FormDiv">
                                            <div class="FormLabel">Ativo:</div>
                                            <asp:DropDownList ID="ddlAtivo" ForeColor="DarkBlue" Font-Bold="true" runat="server" > 
                                                <asp:ListItem Text="Todos" Value=" "></asp:ListItem>
                                                <asp:ListItem Text="Sim" Value="S"></asp:ListItem>
                                                <asp:ListItem Text="N&atilde;o" Value="N"></asp:ListItem>
                                            </asp:DropDownList>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <hr />
                            <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!"
                                  CellPadding="1" ForeColor="#333333" GridLines="Both"  RowStyle-ForeColor="#333333" RowStyle-BackColor="#F7F6F3" >
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                ImageUrl="~/App_Themes/Padrao/imagens/backoffice/editar.gif" CommandArgument='<%#Eval("PKString") %>'
                                                ToolTip="Abrir formulário completo" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="idUsuario" HeaderText="C&oacute;digo" DataFormatString="{0:N0}"/>
                                    <asp:BoundField DataField="nome" HeaderText="Nome"/>
                                    <asp:BoundField DataField="email" HeaderText="Email"/>
                                    <asp:BoundField DataField="user" HeaderText="Login"/>
                                    <asp:TemplateField HeaderText="Ativo?">
                                        <ItemTemplate>
                                          <asp:Label ID="lblativo" runat="server" Text='<%# Eval("ativo")!=null?(bool)Eval("ativo")?"Sim":"N&atilde;o":"" %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#999999" />
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server" BackColor="#eeeeee">
                            <div style="width: 100%; min-width:400px; min-height:300px;">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:Panel ID="panelCadBotoes" runat="server">
                                                <asp:Button ID="btnSalvar" runat="server" Enabled="False" ValidationGroup="Salvar"
                                                    OnClick="btnSalvar_Click" Text="Salvar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                                                    Text="Cancelar" UseSubmitBehavior="false"/>
                                                <asp:Button ID="btnEditar" runat="server" Enabled="False" 
                                                    OnClick="btnEditar_Click" Text="Editar" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnExcluir" runat="server" Enabled="False" 
                                                    OnClick="btnExcluir_Click" Text="Excluir" UseSubmitBehavior="false"/>
                                                &nbsp;<asp:Button ID="btnNovo" runat="server" 
                                                    OnClick="btnNovo_Click" Text="Novo" UseSubmitBehavior="false"/>
                                                <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnExcluir" ConfirmText="Confirma a exclus&atilde;o de Operadores&nbsp;do&nbsp;Sistema?">
                                                </asp:ConfirmButtonExtender>
                                                <hr />
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">C&oacute;digo:</div>
                                                <asp:TextBox ID="txtCadIdUsuario" MaxLength="11" Width="76" onkeypress="onlyNum();" onblur="validaDecimal(this.value,11,0);" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meetxtCadIdUsuario" runat="server" Mask="99999999999" TargetControlID="txtCadIdUsuario" PromptCharacter="" />
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Nome:</div>
                                                <asp:TextBox ID="txtCadNome" MaxLength="45" Width="280" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ControlToValidate="txtCadNome" 
                                                   ErrorMessage="Preenchimento obrigat&oacute;rio." ID="rfvtxtCadNome" Display="None"
                                                   runat="server" ValidationGroup="Salvar" ></asp:RequiredFieldValidator>
                                                <asp:ValidatorCalloutExtender ID="vcetxtCadNome" runat="server" TargetControlID="rfvtxtCadNome"></asp:ValidatorCalloutExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Email:</div>
                                                <asp:TextBox ID="txtCadEmail" MaxLength="45" Width="280" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:RegularExpressionValidator ID="revtxtCadEmail" runat="server" ControlToValidate="txtCadEmail" 
                                                ErrorMessage="email incorreto" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                                 ValidationGroup="Salvar" Display="None" ></asp:RegularExpressionValidator>
                                                <asp:ValidatorCalloutExtender ID="vcerevtxtCadEmail" runat="server" TargetControlID="revtxtCadEmail"></asp:ValidatorCalloutExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Login:</div>
                                                <asp:TextBox ID="txtCadUser" MaxLength="45" Width="280" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ControlToValidate="txtCadUser" 
                                                   ErrorMessage="Preenchimento obrigat&oacute;rio." ID="rfvtxtCadUser" Display="None"
                                                   runat="server" ValidationGroup="Salvar" ></asp:RequiredFieldValidator>
                                                <asp:ValidatorCalloutExtender ID="vcetxtCadUser" runat="server" TargetControlID="rfvtxtCadUser"></asp:ValidatorCalloutExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Senha:</div>
                                                <asp:TextBox ID="txtCadPass" MaxLength="100" Width="200" TextMode="Password" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                            </div>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Confirma&ccedil;&atilde;o de Senha:</div>
                                                <asp:TextBox ID="txtCadConfPass" MaxLength="100" Width="200" TextMode="Password" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Ativo:</div>
                                                <asp:DropDownList ID="ddlCadAtivo" ForeColor="DarkBlue" Font-Bold="true" runat="server" > 
                                                    <asp:ListItem Text="Sim" Value="S"></asp:ListItem>
                                                    <asp:ListItem Text="N&atilde;o" Value="N"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Fone&nbsp;1:</div>
                                                <asp:TextBox ID="txtCadFone1" MaxLength="20" Width="130" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meeFONEtxtCadFone1" runat="server" 
                                                    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="(99)9999-9999" TargetControlID="txtCadFone1" 
                                                    ClearMaskOnLostFocus="true">
                                                </asp:MaskedEditExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Fone&nbsp;2:</div>
                                                <asp:TextBox ID="txtCadFone2" MaxLength="20" Width="130" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meeFONEtxtCadFone2" runat="server" 
                                                    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="(99)9999-9999" TargetControlID="txtCadFone2" 
                                                    ClearMaskOnLostFocus="true">
                                                </asp:MaskedEditExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="FormDiv">
                                                <div class="FormLabel">Fone&nbsp;3:</div>
                                                <asp:TextBox ID="txtCadFone3" MaxLength="20" Width="130" ForeColor="DarkBlue" Font-Bold="true" runat="server"></asp:TextBox>
                                                <asp:MaskedEditExtender ID="meeFONEtxtCadFone3" runat="server" 
                                                    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="(99)9999-9999" TargetControlID="txtCadFone3" 
                                                    ClearMaskOnLostFocus="true">
                                                </asp:MaskedEditExtender>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr />
                                            <table  border="0" cellpadding="0" cellspacing="3">
                                                <tr>
                                                    <td class="FormLabel">
                                                        Data Cadastro:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Cadastrado por:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Data Edi&ccedil;&atilde;o:
                                                    </td>
                                                    <td class="FormLabel">
                                                        Editado por:
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataCadastro" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltCadastradoPor" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltDataEdicao" runat="server"></asp:Literal>
                                                    </td>
                                                    <td class="FormControl">
                                                        <asp:Literal ID="ltEditadoPor" runat="server"></asp:Literal>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
